<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let p = {
      then(resolve, reject) {
        resolve('lisa')
      }
    }
    Promise.resolve(p).then(value => {
      console.log(value)
    })

    Promise.resolve(p).then(value => {
      console.log(value)
    })

    Promise.reject("fail")
      .then(value => {
        console.log(value)
      }).catch(error => {
        console.log(error)
      })

    new Promise((resolve, reject) => {
      resolve('success')
    }).then(value => {
      if(value !== '成功') {
        // throw new Error('fail')
        return Promise.reject('参数错误')
      }
    }).catch(error => {
      console.log(error + 'fail')
    })

  </script>
</body>

</html>